<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" import="com.wrsr.examsys.domain.Teacher"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<script type="text/javascript" src="<%=basePath%>/js/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/jquery.nivo.slider.js"></script>
<title>精品课程网</title>
<%@ include file="base.jsp"%>
<script type="text/javascript">
	function starTimer() {
		timer = window.setInterval("getMessageFromCard();", 2000);
	}
	function getMessageFromCard() {

		var rfId = $(".from-id").text();
		$.ajax({
			type : "POST",
			url : "studentGetMessageFromCard",
			data : ({
				fromId : rfId
			}),
			dataType : "json",
			success : function(msg) {
				var obj = msg;
				$(".discuss-count").text(obj.totalCountMsg);
				$(".discuss-count").css("color", "red");
				$(".discuss-card").text(obj.discussCount);
				$(".discuss-card").css("color", "red");
				$(".reDiscuss-card").text(obj.reDiscussCount);
				$(".reDiscuss-card").css("color", "red");
			}
		});
	}
</script>
</head>
<body>
	<div class="header">
		<div class="header-top">
			<div class="wrap">
				<div class="logo">
					<a href="index.jsp"><img src="<%=basePath%>/images/logo.png"
						alt=""></a>
				</div>
				<div style="float: right; width: 100%; right: 0;">
					<ul>
						<%
							Teacher teacher = (Teacher) request.getSession().getAttribute(
									"teacher");
						%>
						<%
							if (teacher == null) {
						%><li><div style="float: right;">
								<span style="color: #FFFFFF;"><a target="iframepage"
									href='teacherRegist'>注册</a></span>
							</div></li>
						<li><div style="float: right;">
								<span style="color: #FFFFFF;"><a target="iframepage"
									href='teacherLogin'>登陆</a>&nbsp;|&nbsp; </span>
							</div></li>
						<%
							} else {
						%>
						<li>
						<p style="visibility: hidden;" class="from-id"><%=teacher.getEmail() %></p>
						<script type="text/javascript">
							starTimer();
						</script>
						<div style="float: right;">
								<span style="color: #FFFFFF;"><a href='exitTeacher'>安全退出</a>
								</span>
							</div></li>
						<li><div style="float: right;">
								<span style="color: #FFFFFF;"><a target="iframepage"
									href='#'>欢迎您：<%=teacher.getTeacherName()%></a>| </span>
							</div></li>
						<%
							}
						%>

					</ul>
				</div>
				<div class="search_box"></div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="header-bottom">
			<div class="wrap">
				<div id='cssmenu'>
					<ul>
						<li class='active'><a href='index'><span>首页</span></a></li>
			
						<li class='has-sub'><a target="iframepage" class="type">资源管理
						</a>
							<ul>
							<%
									if (teacher != null) {
								%>
								<li class='has-sub'><a target="iframepage"
									href='resoucePage'><span>添加资源</span> </a></li>
								
								<li class='has-sub'><a target="iframepage"
									href='getResouceList'><span>资源列表</span> </a></li>
								<%
									};
								%>
							</ul>
						<li><a target="iframepage" class="type"
							href="http://103.254.110.59:8080/qauexam"> 在线考试 </a></li>
						<li><a class="type"> 在线交流 </a>
							<ul>
								<li class='has-sub'><a target="iframepage"
									href="getCardListByPage"><span>所有帖子</span><span
										id="discuss-count"></span></a></li>
								<li class='has-sub'><a target="iframepage"
									href="addCardPage"><span>发帖问答</span></a></li>
							</ul></li>
							<%
							if (teacher != null) {
						%>
						<li><a class="type"> 消息中心 <span class="discuss-count"></span></a>
							<ul>

								<li class='has-sub'><a target="iframepage"
									href="getCardListNotRead?fromId=<%=teacher.getEmail() %>"><span>帖子评论</span><span
										class="discuss-card"></span></a></li>
								<li class='has-sub'><a target="iframepage"
									href="getReDiscussNotRead?fromId=<%=teacher.getEmail() %>"><span>评论回复</span><span
										class="reDiscuss-card"></span></a></li>

							</ul></li>
						<%
							};
						%>
						<div class="clear"></div>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<!------ Slider ------------>
	<iframe src="<%=basePath%>/index2.jsp" id="iframepage"
		name="iframepage" frameBorder=0 scrolling=no width="100%"
		onLoad="iFrameHeight()"></iframe>
	<script type="text/javascript" language="javascript">
		function iFrameHeight() {
			var ifm = document.getElementById("iframepage");
			var subWeb = document.frames ? document.frames["iframepage"].document
					: ifm.contentDocument;
			if (ifm != null && subWeb != null) {
				ifm.height = subWeb.body.scrollHeight;
			}
		}
	</script>
	<div class="footer-bottom">
		<div class="wrap">
			<div class="copy">
				<p>
					&copy; Copyright &copy; 2014.Company name All rights reserved.<a
						target="_blank" href="http://2397431783.qzone.qq.com">WRSR工作室</a>-About
					us<a href="http://2397431783.qzone.qq.com" target="_blank"
						title="WRSR">&nbsp;WRSR</a>
				</p>
			</div>
		</div>
	</div>


</body>
</html>



